import ProxyInterface from '../proxy-interface';
import {AddinListModel, AccountAddinModel} from '@pkpm/pkpm-types';

class AddinsListProxy implements ProxyInterface<AddinListModel> {
    private addins = new AddinListModel();

    constructor(responseData) {
        let data = responseData.data || responseData;
        Object.assign<AddinListModel, any>(this.addins, data);
    }

    getModel(): AddinListModel {
        return this.addins;
    }
}

class AddinsProxy implements ProxyInterface<AccountAddinModel> {
    private addins = new AccountAddinModel();

    constructor(responseData) {
        let data = responseData.data || responseData;
        Object.assign<AccountAddinModel, any>(this.addins, data);
    }

    getModel(): AccountAddinModel {
        return this.addins;
    }
}

export {AddinsListProxy, AddinsProxy};
